import React,{useState,useEffect} from 'react'
import Son from './Son';

export default function UseEffectDemo() {
    
  //  定义状态
  const [age,setAge] = useState(12);

  function changeAge(){    
    setAge(age+1);
  }

  return (
    <>
      <div>memo高阶函数</div>
      <p>age:{age}</p>
      <input type="button" value="修改age" onClick={changeAge} />
      <Son/>
    </>
  )
}

